<{php}>

	$item = $this->get_template_vars('itemO');

	if (get_class($item) != 'neoobjectitem') {return false;}
	
	$this->assign_by_ref("itemhandler", xoops_getmodulehandler("item",'neoobject'));
<{/php}>
<br>
</br>

<form action="index.php?type=item&func=edit_ok&id=<{$itemO->getVar("id")}>" method=POST enctype="multipart/form-data">
<table class="outer" cellspacing="1" width="100%">
<tbody>
<tr><th colspan="2"><{$smarty.const._MD_neoobject_ITEM_EDIT}></th></tr>
<tr align="left" valign="top">
<td class="head"><{$smarty.const._MD_neoobject_ITEM_TITLE}></td>
<td class="even"><input name="item_title" id="item_title" size="50" maxlength="255" value="<{$itemO->getVar("title")}>" type="text"></td>
</tr>
<tr align="left" valign="top"><td class="head"><{$smarty.const._MD_GOOOBJECT_ITEM_CITY}></td>
<td class="even"><select size="1" name="item_city_id" id="item_city_id">
<{foreach item=idx_cityO from=$itemO->idx_cities}>
	<{if $idx_cityO->getVar('city_id')==$itemO->getVaR('city_id')}>
		<option selected value="<{$idx_cityO->getVar("city_id")}>"><{$idx_cityO->getVar("country_title")}>>><{$idx_cityO->getVar("region_title")}>>><{$idx_cityO->getVar("city_title")}></option>	
	<{else}>
		<option value="<{$idx_cityO->getVar("city_id")}>"><{$idx_cityO->getVar("country_title")}>>><{$idx_cityO->getVar("region_title")}>>><{$idx_cityO->getVar("city_title")}></option>	
	<{/if}>
<{/foreach}>
</select></td></tr>
</tr>
<tr align="left" valign="top"><td class="head"><{$smarty.const._MD_GOOOBJECT_ITEM_TYPE_ID}></td>
<td class="even"><select size="1" name="item_type_id" id="item_type_id">
<{foreach item=type from=$itemhandler->typeH->getObjects()}>
	<{if $type->getVar('id')==$itemO->getVar("type_id")}>
		<option selected value="<{$type->getVar("id")}>"><{$type->getVar("title")}></option>	
	<{else}>
	<option  value="<{$type->getVar("id")}>"><{$type->getVar("title")}></option>	
	<{/if}>
<{/foreach}>
</select></td></tr>
<tr align="left" valign="top">
<td class="head"><{$smarty.const._MD_neoobject_ITEM_ADDRESS}></td>
<td class="even"><input name="item_address" id="item_address" size="50" maxlength="255" value="<{$itemO->getVar("address")}>" type="text"></td>
</tr>
<tr align="left" valign="top"><td class="head"><{$smarty.const._MD_neoobject_ITEM_PHONE}></td>
<td class="even"><input name="item_phone" id="item_phone" size="50" maxlength="255" value="<{$itemO->getVar("phone")}>" type="text"></td>
</tr>
<tr align="left" valign="top"><td class="head"><{$smarty.const._MD_neoobject_ITEM_URL}></td>
<td class="even">
<input name="item_url" id="item_url" size="50" maxlength="255" value="<{$itemO->getVar("url")}>" type="text"></td>
</tr>
<tr align="left" valign="top"><td class="head"><{$smarty.const._MD_neoobject_ITEM_EMAIL}></td>
<td class="even"><input name="item_email" id="item_email" size="50" maxlength="255" value="<{$itemO->getVar("email")}>" type="text"></td>
</tr>
<tr align="left" valign="top"><td class="head"><{$smarty.const._MD_neoobject_ITEM_DESCRIPTION}></td>
<td class="even">
<!--<textarea name="item_description" id="item_description" rows="5" cols="50"><{$itemO->getVar("description",'n')}></textarea>-->
<{gocodetarea name="item_description" value=$itemO->getVar("description",'n')}>
<br/>
<{goimagebtn item_id=$itemO->getVar("id") handler="item" module="neoobject" target="item_description"}>
</td>
</tr></tbody></table>

<!-- START: Properties-->
<table>



<{foreach item=itempropcatO from=$itemO->allpropcategories}>
<tr>
<{cycle values="even,odd" assign=class}>
<td class=<{$class}>><{$itempropcatO->getVar("title")}></td>
<td class=<{$class}>>
<table>
<{foreach item=itempropO from=$itempropcatO->properties}>
<tr>
<td width=200 wordwrap><{$itempropO->getVar("title")}> 
 <{if $itempropO->getVar("measurement")}>
 (<{$itempropO->getVar("measurement")}>)
 <{/if}>
</td>
<td>
<{if $itempropO->getVar('typevalue')==4}>
	<{if $itempropO->value>0}>	
	<input checked type=checkbox name='itemprop2item_value[<{$itempropO->getVar("id")}>]' value="1">
	<{else}>
	<input type=checkbox name='itemprop2item_value[<{$itempropO->getVar("id")}>]' value="1">
	<{/if}>	
<{else}>
<input name='itemprop2item_value[<{$itempropO->getVar("id")}>]' value="<{$itempropO->value}>">
<{/if}>
</td>
</tr>
<{/foreach}>
</table>
</td>

</tr>
<{/foreach}>
</table>
<!-- End : properties-->
<!-- START :images-->
<table>
<{foreach item=xoopsimage2itemO from=$xoopsimage2itemarr}>
<tr>


<{assign var=xoopsimageO value=$xoopsimageH->get($xoopsimage2itemO->getVar("xoopsimage_id"))}>
<{if is_object($xoopsimageO)}>
	<{if file_exists($smarty.const.XOOPS_UPLOAD_PATH|cat:"/"|cat:"thmb_"|cat:$xoopsimageO->getVar("image_name"))}>
	<td>
	<input type=checkbox name=deleteitems[] value=<{$xoopsimage2itemO->getVar("id")}>>
	</td>
	<td>
	<img src="<{$smarty.const.XOOPS_UPLOAD_URL|cat:"/"|cat:$xoopsimageO->getVar("image_name")}>">
	</td>
	<{/if}>
<{/if}>

</tr>
<{/foreach}>
</table>
<!-- END: images-->
<!-- START: photosform-->
<table>
<tbody>
<input type='hidden' name='MAX_FILE_SIZE' value='200000'>
<tr><th colspan="2"><{$smarty.const._MD_neoobject_ITEMPHOTOS_ADD}></th></tr>
<tr align="left" valign="top">
<td class="head"><{$smarty.const._MD_neoobject_ITEMPHOTO_NUM}>1</td>
<td class="even"><input name="item_photo[]" id="item_title" size="50" maxlength="255" value="" type="file"></td>
</tr>
<tr align="left" valign="top">
<td class="head"><{$smarty.const._MD_neoobject_ITEMPHOTO_NUM}>2</td>
<td class="even"><input name="item_photo[]" id="item_title" size="50" maxlength="255" value="" type="file"></td>
</tr>
<tr align="left" valign="top">
<td class="head"><{$smarty.const._MD_neoobject_ITEMPHOTO_NUM}>3 </td>
<td class="even"><input name="item_photo[]" id="item_title" size="50" maxlength="255" value="" type="file"></td>
</tr>
</tbody>
</table>
<!-- END: photosform-->
<input type=submit>


</form>
